﻿using System;
using System.Text;
using System.Collections.Generic;

namespace DreamCube.Framework.Utilities.Report
{
    public class SearchConditionTable : ElementContainer
    {
        #region "字段"

        /// <summary>
        /// 搜索条件表格的html代码
        /// {0}搜索条件的tr html文本
        /// {1}列表的ID号
        /// </summary>
        private static String searchTable =
                            "<table border='0' cellpadding='0' cellspacing='0' style='width:100%'>" +
                                "<tr>" +
                                    "<td>" +
                                        "<table border='0' cellpadding='0' cellspacing='0' class='tCommon' name='SearchConditionTable'>{0}</table>" +
                                    "</td>" +
                                    "<td style='width:100px;vertical-align:middle;' align='center'>" +
                                        "<table border='0' cellpadding='0' cellspacing='0' style='width:100%'>" +
                                           "<tr><td align='center'><input type='button' style='height:30px' value=' 查 询 ' onclick='doSearch()' ReportFormSearchBtn='true' TableID='{1}' /></td></tr>" +
                                        "</table>" +
                                    "</td>" +
                                "</tr>" +
                            "</table>";

        #endregion

        #region "属性"

        /// <summary>
        /// 所属的列表的ID值
        /// </summary>
        public String TableID
        {
            get;
            set;
        }

        #endregion

        #region "方法"

        /// <summary>
        /// 生成Html
        /// </summary>
        /// <returns></returns>
        public override String ToHtml()
        {
            if (this.elements != null && this.elements.Count > 0)
            {
                String trs = base.ToHtml();
                return String.Format(searchTable, trs, TableID);
            }
            return String.Empty;
        }

        #endregion
    }
}
